<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        width: 400px;
        height: 400px;
        background-color: aquamarine;
        margin: 300px 200px;
        position: relative;
    }
</style>

<body>
    <div class="box">
    </div>
    <script>
        let box = document.querySelector('.box');
        box.addEventListener('mousemove', function (e) {
            let x = e.pageX - this.offsetLeft;
            let y = e.pageY - this.offsetTop;
            box.innerHTML=`${x},${y}`
        });
    </script>
</body>

</html>